package co.th.helper.jdbc.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import co.th.helper.jdbc.RowMapper;
import co.th.helper.model.ImpRating;

public class ImpRowMapper extends RowMapper<ImpRating>{

	@Override
	public ImpRating mapRow(ResultSet resultSet) throws SQLException {
		ImpRating imp = new ImpRating();
		if (isThere(resultSet, "imp_code"))
			imp.setImpCode(resultSet.getBigDecimal("imp_code"));
		
		if (isThere(resultSet, "imp_name_th"))
			imp.setImpNameTH(resultSet.getString("imp_name_th"));
		
		if (isThere(resultSet, "imp_name_en"))
			imp.setImpNameEN(resultSet.getString("imp_name_en"));
		
		if (isThere(resultSet, "create_by"))
			imp.setCreateBy(resultSet.getString("create_by"));
		
		if (isThere(resultSet, "create_date"))
			imp.setCreateDate(resultSet.getDate("create_date"));
		
		if (isThere(resultSet, "update_by"))
			imp.setUpdateBy(resultSet.getString("update_by"));
		
		if (isThere(resultSet, "update_date"))
			imp.setUpdateDate(resultSet.getDate("update_date"));
		
		return imp;
	}

}
